import React, {PureComponent} from 'react'
import {View, Text, SafeAreaView, 
    NativeModules, TouchableOpacity} from 'react-native'


const RNIOSAlertModule = NativeModules.RNIOSAlertBridgeModule
export default class MessageNotificationIOS extends PureComponent {
    render(){
        return <SafeAreaView>
                <TouchableOpacity onPress = {this._showAlert}>
                    <Text>一个参数</Text>
                </TouchableOpacity>
                <TouchableOpacity onPress = {this._showTwo}>
                    <Text>两个参数</Text>
                </TouchableOpacity>
                <TouchableOpacity onPress = {this._showThree}>
                    <Text>三个参数</Text>
                </TouchableOpacity>
                <TouchableOpacity onPress = {this._showCallBack}>
                    <Text>回调函数</Text>
                </TouchableOpacity>
            </SafeAreaView>
    }
    _showAlert = () => {
        RNIOSAlertModule.show('RN -> iOS')
    }
    _showTwo = () => {
        RNIOSAlertModule.showName('小强', '男')
    }
    _showThree = () => {
        RNIOSAlertModule.bringSomethingName('小王',{
            'merchant': '苹果',
            'price' : '45'
        })
    }
    _showCallBack =() => {
        RNIOSAlertModule.buySomething((error, merchant)=>{
            if (error){
                console.log(error)
            }else{
        
            }
        })
    }
}